import React, {FC} from 'react';
import {Navigate} from "react-router-dom";
// 1-
// function AuthComponent(props:any) {
//     if(localStorage.getItem("token")){
//         return props.children
//     }else {
//         return <Navigate to={"/login"}/>
//     }
// }
const AuthComponent:FC<any> = props => localStorage.getItem("token")?props.children:<Navigate to={"/login"}/>

export default AuthComponent;